//
//  NearFriendViewController.m
//  安好
//
//  Created by 冯凯 on 14-11-25.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import "NearFriendViewController.h"

@interface NearFriendViewController ()

@end

@implementation NearFriendViewController
/**
 *  存一个状态，为了方便确定是否上传通知隐私
 *
 *  @param animated 无
 */
- (void)viewWillAppear:(BOOL)animated
{
    NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
    NSString * uid = [[UserManager shareInstance]getUserInfo].uid;
    NSString *nearFrined = [NSString stringWithFormat:@"NearFrined%@",uid];
    NSString *nearBack= [NSString stringWithFormat:@"NearBack%@",uid];
    [user setObject:@"NearFrined" forKey:nearFrined];
    [user setBool:YES forKey:nearBack];
    
}
- (void)viewWillDisappear:(BOOL)animated
{
    NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
    NSString * uid = [[UserManager shareInstance]getUserInfo].uid;
    NSString *nearFrined = [NSString stringWithFormat:@"NearFrined%@",uid];
    [user removeObjectForKey:nearFrined];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //加载导航条
    [self makeNavBar];
    //加载数据
    [self loadData];
    //加载tableView
    [self createTableView];
    
}
#pragma - mark 创建显示数据
/**
 *  创建数据
 */
-(void)loadData
{
    self.openArray = @[@"接受新消息通知"];
    self.newsArray = @[@"接收新消息提醒",@"声音",@"震动",@"显示消息详细内容"];
    self.activeArray = @[@"接收活动信息"];
}
#pragma mark - 配置导航条
-(void)makeNavBar
{
    self.navigationItem.title = @"消息设置";
    // 返回按钮图片
    UIBarButtonItem *backBtnImg = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"公用_返回.png"] style:UIBarButtonItemStylePlain target:self action:@selector(backMoreVC)];
    backBtnImg.tintColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = backBtnImg;
}
#pragma mark - 创建tableView设置代理
-(void)createTableView
{
    self.systemTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,iOS7TopMargin, kScreenWidth, kScreenHeight) style:UITableViewStyleGrouped];
    self.systemTableView.delegate = self;
    self.systemTableView.dataSource = self;
    //隐藏横向和竖向的滑条
    self.systemTableView.showsHorizontalScrollIndicator = NO;
    self.systemTableView.showsVerticalScrollIndicator = NO;
    self.systemTableView.backgroundColor = [ClassMethodsViewController colorWithHexString:BACK_BACKGROUNDCOLOR_16];
    [self.view addSubview:self.systemTableView];
}
#pragma - mark 返回
/**
 *  返回
 */
- (void)backMoreVC
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
